
local VipConfig = require("excel.Vip").vip
local InnerDataManagerFW = require("innerdata.InnerDataManagerFW")
local InnerDataDefine = require("innerdata.Define")


function getVipLv(db)
  if db.historyYuanbao < VipConfig[1].needYuanbao then
    return 0
  end
  if db.historyYuanbao >= VipConfig[#VipConfig].needYuanbao then
    return #VipConfig
  end
  for i=1, #VipConfig - 1 do
    if db.historyYuanbao >= VipConfig[i].needYuanbao and db.historyYuanbao < VipConfig[i + 1].needYuanbao then
      return i
    end
  end
  return 0
end


function buyMonthCard(human, cnt)
  local info = {}
  info.cnt = cnt
  InnerDataManagerFW.Send2LInnerData(human, InnerDataDefine.INNERDATA_TYPE_BUY_MONTHCARD, info)
end
